﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPI.Entities.Kml;

namespace PPI.Entities
{
    public class ECentralOffice : EBasePosition
    {
        private Int32 m_Id;
        private string m_Name;

        public Int32 Id
        {
          get
          {
            return m_Id;
          }
          set
          {
            m_Id = value;
          }
        }
        public string Name
        {
          get
          {
            return m_Name;
          }
          set
          {
            m_Name = value;
          }
        }

        public ECentralOffice()
            :base()
        {
            m_Id = Int32.MinValue;
            m_Name = string.Empty;
        }

        public ECentralOffice(int id)
        :this()
        {
            m_Id = id;
        }

        public ECentralOffice(int id, string name, double latitude, double longitude)
        :this(id)
        {
            m_Name = name;
            Latitude = latitude;
            Longitude = longitude;
        }
        public ECentralOffice(int id, string name, double latitude, double longitude, string address)
            : this(id,name,latitude,longitude)
        {
            Address = address;
        }

        public override string GetIcon()
        {
            return Constants.K_BASEREDMARK;
        }

        public override string GetHtmlName()
        {
            return GetAddress();
        }

        public override string GetHtmlPlacemark()
        {
            return GetAddress();
        }

        public static List<EKmlFile> GetCentralOffices()
        {
            List<EKmlFile> listKml = new List<EKmlFile>();

            //Ovid
            ECentralOffice _office = new ECentralOffice();
            _office.Latitude = 39.176730;
            _office.Longitude = -108.124880;
            _office.Altitude = 0;
            _office.Address = "100 Main Street Ovid, CO  80744";
            listKml.Add(_office.ToKml());

            //Holyoke
            _office = new ECentralOffice();
            _office.Latitude = 40.579450;
            _office.Longitude = -102.302170;
            _office.Altitude = 0;
            _office.Address = "16107 Hwy 14 Sterling, CO  80751";    
            listKml.Add(_office.ToKml());

            //Sterling
            _office = new ECentralOffice();
            _office.Latitude = 40.522920;
            _office.Longitude = -103.239810;
            _office.Altitude = 0;
            _office.Address = "1300 S Interocean Holyoke, CO  80734";
            listKml.Add(_office.ToKml());
            return listKml;
        }

        public override string GetPlacemarkId()
        {
            return "CentralOffice_"+Id.ToString();
        }

    }
}
